<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
		<script src="{{url_for('static', filename='js/bootstrap.min.js')}}"></script>
		<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/bootstrap.min.css')}}" />
	</head>

	<body>
		<nav class="navbar navbar-inverse">
			<div class="container-fluid">
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
                                        <a class="navbar-brand" href="#">Puss in Boots</a>
				</div>

				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a href="{{url_for('home_page')}}">首页 <span class="sr-only">(current)</span></a></li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">我的博客 <span class="caret"></span></a>
							<ul class="dropdown-menu">
								<li><a href="{{url_for('myblog')}}">博客主页</a></li>
								<li><a href="{{url_for('new_blog')}}">添加博客</a></li>
								<li role="separator" class="divider"></li>
								<li><a href="{{url_for('add_type')}}">添加类别</a></li>
							</ul>
						</li>
						<li><a href="#">关于我</a></li>
					</ul>
					<form class="navbar-form navbar-left" role="search" method="POST" action="{{ url_for('search') }}">
						<div class="form-group">
							<input type="text" class="form-control" name="search" placeholder="Search">
						</div>
						<button type="submit" class="btn btn-default">搜索</button>
					</form>

					<ul class="nav navbar-nav navbar-right">

						{% if not session.logged_in %}
						<li><a href="{{ url_for('login') }}">用户登录</a></li>
						<li><a href="{{ url_for('register') }}">用户注册</a></li>
						{% else %}
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                {{session.cur_username}} <span class="caret"></span>
            </a>

							<ul class="dropdown-menu" role="menu">
								<li><a href="{{ url_for('logout') }}"><i class="fa fa-btn fa-sign-out"></i>登出</a></li>
							</ul>
						</li>
						{% endif %}

					</ul>
				</div>
				<!-- /.navbar-collapse -->
			</div>
			<!-- /.container-fluid -->
		</nav>

		<div class="container">
			<div class="row">
				{% for message in get_flashed_messages() %}
				<div class=flash>{{ message }}</div>
				{% endfor %} {% block body %} {% endblock %}
			</div>
		</div>

	</body>

</html>